<%@ include file="common.jsp"%>

<div id="mainDashBoard" align="center">
	<table style="width: 90%">
		<tr class="formSpacingRow"></tr>
		<tr>
			<td class="mainDashBoardFont mainDashBoardColor"><span>Welcome</span>
				<sec:authentication property="principal.userDisplayName"></sec:authentication>
				<br /> <span style="color: #000000 !important;">This is your
					dashboard</span></td>
		</tr>
		<tr class="formSpacingRow"></tr>
		<tr class="formSpacingRow"></tr>
		<tr>
			<td>
				<div style="width: 80%;">
				<c:choose>
					<c:when test="${sizeOfData eq 0}">
					No Records Found.
				</c:when>
					<c:otherwise>
						<table class="viewDetails">
							<tr class="heading">
								<th>Status</th>
								<th>Type</th>
								<th>Number of Documents</th>
							</tr>
							<c:forEach items="${dashboardData}" var="dashboardData" varStatus="loop">
								<c:set var="tabColor" value="odd"></c:set>
								<c:if test="${(loop.index % 2) eq 0}">
									<c:set var="tabColor" value="even"></c:set>
								</c:if>
								<tr class="${tabColor}">
									
									<c:set var="typeCount" value="${fn:length(dashboardData.value)}"></c:set>
									<td rowspan="${typeCount}">
										<c:out value="${statusMap[dashboardData.key]}"></c:out>
										<c:forEach items="${dashboardData.value}" var="values" varStatus="loop">
											<c:if test="${loop.index eq 0 }">
												<td>${values.key}</td>
												<td>${values.value}</td>
											</c:if>
										</c:forEach>
									</td>
								</tr>
								<c:forEach items="${dashboardData.value}" var="values" varStatus="loop">
									<c:if test="${loop.index ne 0 }">
									<tr class="${tabColor}">
										<td>${values.key}</td>
										<td>${values.value}</td>
									</tr>
									</c:if>
								</c:forEach>
							</c:forEach>
						</table>
					</c:otherwise>
				</c:choose>
				</div>	
			</td>
			<td style="width: 20%;">
				<table class="fullUse" border="0">
					<c:if test="${enableChangePassword eq 1}">
					<tr align="center" class="silverBackground">
						<td style="padding-left: 20px; padding-right: 0px;"><img
							alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-16.png"
							onclick="showChangePwdDialog();" style="cursor: pointer;"></td>
						<td align="left"><span class="mainDashBoardColor"
							onclick="showChangePwdDialog();" >Change Password</span> <!-- <br/>
							<span onclick="showChangePwdDialog();">Change Password</span>
							<br/>
							<span>Change User Details</span> --></td>
					</tr>
					</c:if>
					<tr align="center" class="silverBackground">
						<td style="padding-left: 20px; padding-right: 0px;"><img
							alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-17.png" style="cursor: pointer;">
						</td>
						<td align="left"><span class="mainDashBoardColor">Information</span>
						</td>
					</tr>
					<tr align="center" class="silverBackground">
						<td style="padding-left: 20px; padding-right: 0px;" ><img
							alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-18.png" style="cursor: pointer;">
						</td>
						<td align="left"><span class="mainDashBoardColor">Help</span>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>
</div>